<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
      th:replace="~{layout/layout :: layout(~{::title}, ~{::section})}">
<head>
    <title>用户注册</title>
</head>
<body>
    <section>
        <h2>用户注册</h2>
        
        <form th:action="@{/users/register}" th:object="${user}" method="post">
            <!-- 全名 -->
            <div class="form-group">
                <label for="fullName">姓名</label>
                <input type="text" id="fullName" th:field="*{fullName}" placeholder="请输入您的姓名">
                <div class="error-message" th:if="${#fields.hasErrors('fullName')}" th:errors="*{fullName}"></div>
            </div>
            
            <!-- 邮箱 -->
            <div class="form-group">
                <label for="email">电子邮箱</label>
                <input type="email" id="email" th:field="*{email}" placeholder="请输入有效的电子邮箱">
                <div class="error-message" th:if="${#fields.hasErrors('email')}" th:errors="*{email}"></div>
            </div>
            
            <!-- 密码 -->
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password" th:field="*{password}" placeholder="请输入强密码">
                <div class="error-message" th:if="${#fields.hasErrors('password')}" th:errors="*{password}"></div>
                <small>密码必须至少8位，包含大小写字母、数字和特殊字符</small>
            </div>
            
            <!-- 出生日期 -->
            <div class="form-group">
                <label for="birthday">出生日期</label>
                <input type="date" id="birthday" th:field="*{birthday}" placeholder="YYYY-MM-DD">
                <div class="error-message" th:if="${#fields.hasErrors('birthday')}" th:errors="*{birthday}"></div>
            </div>
            
            <!-- 性别 -->
            <div class="form-group">
                <label>性别</label>
                <div class="radio-group">
                    <input type="radio" id="male" th:field="*{gender}" th:value="${T(com.example.demo.model.User.Gender).MALE}">
                    <label for="male">男</label>
                    
                    <input type="radio" id="female" th:field="*{gender}" th:value="${T(com.example.demo.model.User.Gender).FEMALE}">
                    <label for="female">女</label>
                </div>
                <div class="error-message" th:if="${#fields.hasErrors('gender')}" th:errors="*{gender}"></div>
            </div>
            
            <!-- 职业 -->
            <div class="form-group">
                <label for="profession">职业</label>
                <input type="text" id="profession" th:field="*{profession}" placeholder="请输入您的职业">
                <div class="error-message" th:if="${#fields.hasErrors('profession')}" th:errors="*{profession}"></div>
            </div>
            
            <!-- 婚姻状况 -->
            <div class="form-group">
                <div class="checkbox-group">
                    <input type="checkbox" id="married" th:field="*{married}">
                    <label for="married">已婚</label>
                </div>
            </div>
            
            <!-- 备注 -->
            <div class="form-group">
                <label for="note">备注</label>
                <textarea id="note" th:field="*{note}" placeholder="请输入备注信息（可选）"></textarea>
                <div class="error-message" th:if="${#fields.hasErrors('note')}" th:errors="*{note}"></div>
            </div>
            
            <!-- 提交按钮 -->
            <div class="btn-group">
                <button type="submit" class="btn">注册</button>
            </div>
        </form>
    </section>
</body>
</html> 